/*
 * cx_datetime_symbian.c
 *
 *  Created on: 2010-3-9
 *      Author: raycchen
 */

#include "cx_predef.h"
#include "cx_datetime.h"
#include "vmsys.h"

QVOID cx_getLocalTime(QTime* p)
{
    if (p) {
		    vm_time_t time;
			long nMicroSec;
			vm_get_time(&time);


			p->wYear = time.year;
    		p->nMonth = time.mon;
    		p->nDay = time.day;
    		p->nHour = time.hour;
    		p->nMin = time.min;
    		p->nSec = time.sec;
			nMicroSec = vm_get_tick_count();
    		p->nMicroSec = nMicroSec;
    }   
}

QVOID cx_getUTCTime(QTime* p)
{
    if (p) {
    	cx_getLocalTime(p);
    }
}

QVOID cx_getTimeFromPlatformInt(QTime* p,QVOID* pInt)
{
// 	TInt64 *pTime = (TInt64*)pInt;
// 	TTime time(*pTime);
// 	
// 	TDateTime Date = time.DateTime();//.Day()
	p->wYear = 2010;
	p->nMonth = 1;
	p->nDay = 1;
	p->nHour = 23;
	p->nMin = 59;
	p->nSec = 59;    		
}


QVOID* cx_datetime_getData(QTime* p)
{
// 	TDateTime Date;// = time.DateTime();//.Day()
// 	Date.SetYear((int)p->wYear);
// 	TMonth month = (TMonth)p->nMonth;
// 	Date.SetMonth(month);
// 	Date.SetDay(p->nDay);
// 	Date.SetHour(p->nHour);
// 	Date.SetMinute(p->nMin);
// 	Date.SetSecond(p->nSec);
// 	Date.SetMicroSecond(p->nMicroSec);
// 	
// 	TTime time(Date); 
// 	TInt64 pTime = time.Int64();
// 	return (QVOID*)(&pTime);   		
	return QNULL;
}

